<template>
  <el-date-picker   v-model="date" @change="onchange">

  </el-date-picker>
</template>
<script>
  export default {
    props:['value'],
    data(){
      return {
        date:null
      }
    },
    created(){
      this.date = new Date(this.value);
    },
    methods:{
      onchange(value){
        console.log("select "+value)
           this.date=value;
          this.$emit('input', new Date(this.date).toLocaleDateString())
      }
    }
  }
</script>
